package com.uu.it.tracker.preferences;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.Toast;

public class PersonalInfoMenu extends Activity {
	
	 public String weightalue;
	 Intent myIntent = new Intent();
	
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
		//Toast.makeText(this,"personal info menu",Toast.LENGTH_SHORT).show();		
		
		AlertDialog.Builder alert = new AlertDialog.Builder(this);
		//alert.setTitle("Enter ");
		alert.setMessage("Enter your Weight:");

		// You can set an EditText view to get user input besides
		// which button was pressed.
		final EditText weight = new EditText(this);
		alert.setView(weight);

		alert.setPositiveButton("ok", new DialogInterface.OnClickListener() {
		public void onClick(DialogInterface dialog, int whichButton) {
		weightalue = weight.getText().toString();
		 Intent intent = new Intent();
		 setResult(RESULT_OK, intent);
         finish();
		
		  // Do something with value!
		  }
		});
		
		alert.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int whichButton) {
				
				 Intent intent = new Intent();
	                setResult(RESULT_CANCELED, intent);
	                finish();
	                
			 // String value = input.getText();
			  // Do something with value!
			  }
		}); 
			
		alert.show();
		

		
		
	}

}